home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Source Code / C / Applications / Python 1.3 / Python 1.3 PPC / Tools / bgen / dlg / progressbar.py < prev    next >
Encoding:
Python Source  |  1995-10-11  |  562 b   |  32 lines  |  [TEXT/PYTH]

  1. # Progress dialog
  2.  
  3. from addpack import addpack
  4. addpack('Tools')
  5. addpack('bgen')
  6. addpack('dlg')
  7. addpack('evt')
  8.  
  9. from Dlg import GetNewDialog, ModalDialog, SetDialogItemText
  10.  
  11. count = 0
  12.  
  13. def filter(d, e):
  14.     r = 1
  15.     print "Filter(%s, %s) -> %s" % (`d`, `e`, `r`)
  16.     return r
  17.  
  18. def main():
  19.     d = GetNewDialog(256, -1)
  20.     tp, h, rect = d.GetDialogItem(2)
  21.     SetDialogItemText(h, "Progress...")
  22.     for i in range(100):
  23.         if i%10 == 0:
  24.             str = "Progress...%d" % i
  25.             SetDialogItemText(h, str)
  26.             ModalDialog(filter)
  27.         for j in range(100): pass
  28.  
  29. if __name__ == '__main__':
  30.     main()
  31.  
  32.